<?php if (!defined("MAIN_DIR")) { header("Location: /"); die; }

if (!$user->isAdmin() && $route->getAdminPlace() != 'enter'){
	require_once ADMIN.DS."authorization.php";
	die;
}

switch ($route->getAdminPlace()) {

	case "":		require_once ADMIN.""; break;
	case "enter":	require_once ADMIN."enter.php"; break;
	case "logout":	$user->logout(); header("Location: ".$_SERVER['HTTP_REFERER']); break;
	
	default: 		to("/admin/companies");
}

?>